﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganisationList.ascx.cs" Inherits="MockPrjTeam4.OrganisationList" %>
<%@ Import Namespace="MockPrjTeam4.Entity"  %>
<script type="text/javascript">
    function Confirm_Alert() {
        return confirm('Do you want to make this Organisation active ?');
    }
</script>
<style type="text/css">
    .wrap
    {
        border: 1px solid #330099;  
        margin-left: 50px;  
        margin-top: 50px;
        width: 800px;
        padding-right: 50px;
        padding-left: 50px;
    }
    .result
    {
        margin-left: 350px;
        font-size: larger;
        font-weight: bold;
        color: red;
        }
    .orgName
    {
        color: blue;
        }
</style>
<div class="wrap">
    <table border="0" cellspacing="2px" cellpadding="2px" width="100%">
    	<tr>
    		<td>
                <span style="color: Blue; font-weight: bold; font-size: x-large">Organisation List</span>
            </td>
    	</tr>
        <tr>
            <td>
                <asp:LinkButton ID="lkbtnAll" runat="server" Text="All" ForeColor="Blue"
                            CommandName="SearchAll" OnCommand="Click"></asp:LinkButton>&nbsp|&nbsp
            <asp:LinkButton ID="lkbtn09" runat="server" Text="0 - 9" ForeColor="Blue"
                            CommandName="Search09" OnCommand="Click"></asp:LinkButton>&nbsp|&nbsp
            <asp:LinkButton ID="lkbtnAE" runat="server" Text="A B C D E" ForeColor="Blue"
                            CommandName="SearchAE" OnCommand="Click"></asp:LinkButton>&nbsp|&nbsp
            <asp:LinkButton ID="lkbtnFJ" runat="server" Text="F G H I J" ForeColor="Blue"
                            CommandName="SearchFJ" OnCommand="Click"></asp:LinkButton>&nbsp|&nbsp
            <asp:LinkButton ID="lkbtnKN" runat="server" Text="K L M N" ForeColor="Blue"
                            CommandName="SearchKN" OnCommand="Click"></asp:LinkButton>&nbsp|&nbsp
            <asp:LinkButton ID="lkbtnOR" runat="server" Text="O P Q R" ForeColor="Blue"
                            CommandName="SearchOR" OnCommand="Click"></asp:LinkButton>&nbsp|&nbsp
            <asp:LinkButton ID="lkbtnSV" runat="server" Text="S T U V" ForeColor="Blue"
                            CommandName="SearchSV" OnCommand="Click"></asp:LinkButton>&nbsp|&nbsp
            <asp:LinkButton ID="lkbtnWZ" runat="server" Text="W X Y Z" ForeColor="Blue"
                            CommandName="SearchWZ" OnCommand="Click"></asp:LinkButton>
            </td>
            <td align="right">
                <asp:Button ID="btnCreate" runat="Server" Text="Create" 
                    onclick="btnCreate_Click"/>&nbsp
                <asp:CheckBox ID="chkInactive" runat="Server" Text="Include in-active" 
                    OnCheckedChanged="chkInactive_CheckedChanged" AutoPostBack="true"/>
                    <asp:HiddenField Id="hdffilter" runat="Server"/>
            </td>
        </tr>
        <tr>
            <td>
                <div class="result">
                    <asp:Label ID="lblMessageResult" runat="Server"></asp:Label>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:GridView ID="gvListOrg" runat="Server" AllowSorting="True" AllowPaging="true"
                PageSize="15" DataKeyNames="OrganisationId" AutoGenerateColumns="False"
                    BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" 
                    CellPadding="4" Width="95%" OnPageIndexChanging="gvListOrg_PageIndexedChanging">
                    <Columns>
                        <asp:TemplateField HeaderText="Organisation Name">
                            <ItemTemplate>
                                <asp:LinkButton ID="lkbtnOrgName" runat="Server" ForeColor="Blue"
                                OnClientClick='<%# !(bool)Eval("IsActive") ? "return Confirm_Alert();" : string.Empty %>'
                                CommandName='<%# Eval("OrganisationId") %>' CommandArgument='<%# Eval("IsActive") %>'
                                OnCommand="lkbtnOrgName_Click" ><%# Eval("OrganisationName")%></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle ForeColor="Black"/>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="Head Office Address Line 1" DataField="AddressLine1"/>
                        <asp:BoundField HeaderText="Postcode" DataField="Postcode" />
                        <asp:BoundField HeaderText="Contact" DataField="ContactName" />
                        <asp:BoundField HeaderText="Is Active" DataField="IsActive" />
                    </Columns>
                    <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
                    <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
                    <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
                    <RowStyle BackColor="White" ForeColor="#330099" />
                    <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
                    <SortedAscendingCellStyle BackColor="#FEFCEB" />
                    <SortedAscendingHeaderStyle BackColor="#AF0101" />
                    <SortedDescendingCellStyle BackColor="#F6F0C0" />
                    <SortedDescendingHeaderStyle BackColor="#7E0000" />
                </asp:GridView>
            </td>
        </tr>
    </table>
</div>
